package com.hsmw.api.controller.biz;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hsmw.api.service.HsmwDriverUserService;
import com.hsmw.api.service.HsmwOrderService;
import com.hsmw.api.service.HsmwUserService;
import com.hsmw.api.vo.DriverRegisterPageVO;
import com.hsmw.common.base.BaseController;
import com.hsmw.common.base.BasePage;
import com.htn.common.core.base.DataResponse;
import com.hsmw.domain.HsmwUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author WD
 */
@Api(tags = "BIZ-司机注册管理")
@RestController
@RequestMapping("/api/driver/register")
public class BizDriverRegisterController extends BaseController<HsmwUserService, HsmwUser> {

	@Autowired
	private HsmwDriverUserService hsmwDriverUserService;


	/**
	 * 分页
	 *
	 * @param basePage
	 * @return
	 */
	@ApiOperation(value = "获取司机注册分页列表", notes = "获取司机注册分页列表", produces = "application/json")
	@PostMapping("/getDriverRegisterPage")
	public DataResponse getDriverRegisterPage(@RequestBody @Valid BasePage<DriverRegisterPageVO> basePage) {
		IPage page = new Page(basePage.getPageNo(), basePage.getPageSize());
		DriverRegisterPageVO driverRegisterPageVo = basePage.getRequestData();
		IPage<DriverRegisterPageVO> data = hsmwDriverUserService.getDriverRegisterPage(page, driverRegisterPageVo);
		return new DataResponse(data);
	}


}
